export default class InteractionTimerService {
    constructor(parent) {
        this.parent = parent;
    }

    initTimeValue(second) {
        this.parent.Logger.debug("InteractionTimer initTimeValue " + second);
        if (second >= 0) {
            var min = parseInt(second / 60);
            var sec = second % 60;
            if (min >= 0 && sec >= 0) {
                this.parent._setTimeValue(min, sec);
            }
        }
    }

    /**
     *设置当前时间,以秒为单位
     * @param second
     */
    setTimeValue(second) {
        if (second >= 0) {
            var min = parseInt(second / 60);
            var sec = second % 60;
            if (min >= 0 && sec >= 0) {
                this.parent._setTimeValue(min, sec);
            }
        }
    }

    setVisible(enable) {
        this.parent.Logger.debug("InteractionTimer setVisible " + enable);
        if (enable) {
            this.parent.$view.show();
        } else {
            this.parent.$view.hide();
        }
    }

    setLocationProperties(properties) {
        this.parent.languageKeySet = properties;
    }
}